import request from '@/utils/request';


export function lockDmsClass(id){
    return request({
        url:"/dormitory/dms-dormitory-class/lockDmsClass/"+id,
        method:"POST"
    }); 
}


export function listClassCanStu(params){
    return request({
        url:"/dormitory/dms-dormitory-class/listClassCanStu",
        method:"GET",
        params
    });
}


export function cancelReg(data){
    return request({
        url:"/dormitory/dms-dormitory-class/cancelReg",
        method:"POST",
        data
    }); 
}

export function addReg(data){
    return request({
        url:"/dormitory/dms-dormitory-class/addReg",
        method:"POST",
        data
    }); 
}

export function listClassStu(code){
    return request({
        url:"/dormitory/dms-dormitory-class/listClassStu/"+code,
        method:"GET"
    });
}


export function getRegByRoom(id){
    return request({
        url:"/dormitory/dms-dormitory-class/getRegByRoom/"+id,
        method:"GET",
    }); 
}

export function changeRoomIsMixed(data){
    return request({
        url:"/dormitory/dms-dormitory-class/changeRoomIsMixed",
        method:"POST",
        data
    });
}

export function listFdyRoom(params){
    return request({
        url:"/dormitory/dms-dormitory-class/listFdyRoom",
        method:"GET",
        params
    });
}

export function changeClassBed(data){
    return request({
        url:"/dormitory/dms-dormitory-class/changeClassBed",
        method:"post",
        data
    });
}

export function xwDomClass(data){
    return request({
        url:"/dormitory/dms-dormitory-class/xwDomClass",
        method:"post",
        data
    });
}


export function selectXwClass(){
    return request({
        url:"/dormitory/dms-dormitory-class/selectXwClass",
        method:"get"
    });
}


export function selectXwDom(params){
    return request({
        url:"/dormitory/dms-dormitory-class/selectXwDom",
        method:"get",
        params
    });
}


// 查看学院人数
export function getCollegeNumber() {
    return request({
        url: "/dormitory/dms-dormitory-class/selectDept",
        method: "GET",
    })
}

// 查看专业人数
export function getMajorNumber(collegeCode) {
    return request({
        url: "/dormitory/dms-dormitory-class/selectMajor",
        method: "GET",
        params: {
            XYDM: collegeCode
        }
    })
}

// 获取宿舍楼剩余宿舍
export function BuildingDormitory(query) {
    return request({
        url: "/dormitory/dms-dormitory-class/selectBuilding",
        method: "GET",
        params: query
    })
}

// 根据宿舍楼id获取楼层
export function listFloor(query) {
    return request({
        url: "/dormitory/dms-dormitory-class/selectFloor",
        method: "GET",
        params: query
    })
}

// 根据宿舍楼id获取单元
export function listUnit(query) {
    return request({
        url: "/dormitory/dms-dormitory-class/selectUnit",
        method: "GET",
        params: query
    })
}


// 根据楼栋id查看宿舍
export function listDormitory(query) {
    return request({
        url: "/dormitory/dms-dormitory-class/selectDorm",
        method: "GET",
        params: query
    })
}

// 专业划分宿舍区域
export function allocate(data) {
    return request({
        url: "/dormitory/dms-dormitory-class/allocate",
        method: "post",
        data
    })
}

// 取消绑定某宿舍
export function unbindDor(data) {
    return request({
        url: "/dormitory/dms-dormitory-class/delete",
        method: "post",
        data
    })
}